import Mock from "mockjs";
const Random = Mock.Random;

export const mockmyholdings = function (){
    let list=[]
    for (let i = 0; i < Random.integer(10,20); i++) {
        var fund_amount=Random.float(0,10000,2,2)
        var holding_profit=Random.float(-2000,2000,2,2)
        var yesterday_profit=Random.float(-500,500,2,2)
        const object = Mock.mock({
            'id|1-100':1,
            fund_amount:fund_amount,
            yesterday_profit: yesterday_profit,
            holding_profit: holding_profit,
            fund_name:'基金'+'@natural(1,100)',
            holding_profit_rate: (holding_profit/fund_amount*100).toFixed(2)
        });

        list.push(object);
    }

    return {
    
        data: list,
        flag: true,
      };
}
